#ifndef CMN_H
#define CMN_H

#include "common.h"
#include "stm32f10x.h"

#define setBit(data, nbit)     (data = data|(1<<nbit)) 
#define clrBit(data, nbit)     (data = data&(~(1<<nbit))) 
#define tstBit(data, nbit)     (data&(1<<nbit))         


typedef struct
{
    uint64_t old;                                
    uint64_t current;
}STD_TIME_STAMP;

extern uint8_t Cmn_hexcharToValue(uint8_t val);
extern void Cmn_byteToHexchar(uint8_t data, uint8_t* result);
extern void Cmd_int8uToString(uint8_t data, uint8_t* result);
extern void Cmd_int32uToString(uint32_t data, uint8_t* result);
extern uint32_t Cmd_isequalString(uint8_t* a, uint8_t* b);
extern uint32_t Cmd_isequalByteArray(uint8_t* a, uint8_t* b, uint32_t length);
extern uint32_t replaceCharinString(uint8_t* result, uint8_t* in, uint8_t p_char);
extern void LockNumH2A(uint8_t *inbuf,uint8_t *outbuf);
extern void Hex2Str(unsigned char hex);
extern uint16_t Pausedat(uint8_t dat1,uint8_t dat2);
#endif